package com.dyna.api.feign;

import com.dyna.api.domain.resp.SysOAuth2AccessTokenCheckResp;
import com.dyna.api.failback.AuthTokenFailBack;
import com.dyna.constants.AppConstant;
import com.dyna.core.config.FeignConfig;
import com.dyna.domain.resp.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author zhoucaiwang
 * @date 2024/3/30
 */

@FeignClient(name = AppConstant.APPLICATION_AUTH_NAME,
        value = AppConstant.APPLICATION_AUTH_NAME,
        fallback = AuthTokenFailBack.class,
        configuration = FeignConfig.class)
public interface AuthTokenApi {

    String TOKEN_PREFIX = "/token";

    /**
     * 验证令牌
     * @param accessToken 访问令牌
     * @return R<SysOAuth2AccessTokenCheckResp>
     */
    @RequestMapping(value = TOKEN_PREFIX + "/check")
    R<SysOAuth2AccessTokenCheckResp> checkAccessToken(@RequestParam("accessToken") String accessToken);


}
